﻿using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace Inovout.Web.Mvc
{
    public static class TemplateExtensions
    {

        public static IHtmlString Dynamic(this HtmlHelper html, string templateHtml, string pattern, string partialViewName)
        {
            
            return MvcHtmlString.Create(Regex.Replace(templateHtml,pattern,
                html.Partial(partialViewName).ToString()));
        }
    }
}
